package memory;

import java.awt.Color;
import javax.swing.JPanel;
import java.util.ArrayList;
import memory.Memory.block;


public class MemoryPanel extends JPanel{
	
	public static ArrayList<Color> colors = new ArrayList<Color>();
	public static int index = 0;
	static{
		colors.add(Color.BLUE);
		colors.add(Color.GRAY);
		colors.add(Color.RED);
		colors.add(Color.green);
		colors.add(Color.YELLOW);
		colors.add(Color.ORANGE);
		colors.add(Color.PINK);
		colors.add(Color.magenta);
	}
	
	public MemoryPanel(){
	}
	
	public MemoryPanel(block block){
		setLayout(null);
		this.setBounds(block.getStart()+95, 100 , block.getLength() , 100);
		this.setBackground(MemoryPanel.colors.get(index));
		index++;
		if(index>=colors.size()) index=index-colors.size();
		
	}
	
	
}
 